#ifndef QNBCAPTUREVIDEOFRAME_H
#define QNBCAPTUREVIDEOFRAME_H

//added by xuhongneng 20170826 begin

#include <QAbstractVideoSurface>
#include <QCamera>
#include <QLabel>

class CCaptureVideoFrame : public QAbstractVideoSurface
{
    Q_OBJECT
public:
    explicit CCaptureVideoFrame(QObject *parent = 0);

    virtual QList<QVideoFrame::PixelFormat> supportedPixelFormats(
            QAbstractVideoBuffer::HandleType handleType = QAbstractVideoBuffer::NoHandle) const;

    bool setSource(QCamera *pCamera);

    inline void setLabel(QLabel * plbFrame){
        m_plbFrame = plbFrame;
    }

//signals:
private:
    //视频帧捕获信号
    void CaptureFrame(const QVideoFrame &frame);

private slots:
    virtual bool present(const QVideoFrame &frame);
private:
    QLabel *m_plbFrame;
    bool m_needsHorizontalMirroring;
};


#endif // QNBCAPTUREVIDEOFRAME_H
